<!-- templates/index.html -->
{% extends "base.html" %}

{% block content %}
<h2>最近的事件</h2>
<table>
    <thead>
        <tr>
            <th>ID</th>
            <th>类型</th>
            <th>时间戳</th>
            <th>数据</th>
        </tr>
    </thead>
    <tbody>
        {% for event in events %}
        <tr>
            <td>{{ event.id }}</td>
            <td>{{ event.event_type }}</td>
            <td>{{ event.timestamp }}</td>
            <td>{{ event.data }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>

<h2>查询事件</h2>
<form action="{{ url_for('view_events') }}" method="get">
    <label for="event_type">事件类型：</label>
    <input type="text" id="event_type" name="event_type">
    <button type="submit">搜索</button>
</form>
{% endblock %}
